$(document).ready(init);

function init() {
	$('#left').accordion('select', '消费总金额');
	
	showContent({
	});
	
	$('#search').click(doSearch);
}

function doSearch() {
	showContent({
		startTime : $.trim($('#startTime').val()),
		endTime : $.trim($('#endTime').val())
	});
}

/**
 * 显示信息
 */
function showContent(queryParams) {
	$('#Consumeinfo').datagrid({
	    title:'',
	    iconCls:'icon-save',
	    singleSelect:true,
	    url:'consumeinfo!queryConsumeinfos.action',
	    idField: 'id',
	    queryParams :queryParams,
	    showFooter:true,
	    nowrap:true,
	    columns:[[
	        {field:'empno',title:'员工编号',width:fixWidth(0.12)},
	        {field:'cardNo',title:'卡号',width:fixWidth(0.12)},
	        {field:'deptName',title:'机构名称',width:fixWidth(0.12)},
	        {field:'consumetime',title:'消费时间',width:fixWidth(0.12)},
	        {field:'fine',title:'罚款金额(元)',width:fixWidth(0.1),align:'center'},
	        {field:'setupcharges',title:'开机费(元)',width:fixWidth(0.09),align:'center'},
	        {field:'monetary', title:'消费金额(元)',width:fixWidth(0.09),align:'center'},
	        {field:'othersmoney',title:'其它金额(元)',width:fixWidth(0.09),align:'center'},
			{field:'nousemoney',title:'未使用罚款(元)',width:fixWidth(0.09),align:'center'},
			{field:'totalmoney', title:'消费累计(元)', width:fixWidth(0.12)}
	    ]],
	    pagination:true,
	    rownumbers:true,
	    fitColumns:true
	});
}